import request from "../../http";
const contractApi = {
  async getContractData(query) {
    return request({
      url: "/api/contractTemp/list",
      method: "get",
      params: query
    });
  },
  async getContractDetail(id) {
    return request({
      url: `/api/contractTemp/${id}`,
      method: "get"
    });
  },
  async queryContractData(query) {
    return request({
      url: "/api/contractTemp/list",
      method: "get",
      params: query
    });
  },
  async changeState(query) {
    return request({
      url: "/api/contractTemp/disable",
      method: "post",
      params: query
    });
  },
  async postContractData(parmas) {
    return request({
      url: "/api/contractTemp",
      method: "post",
      data: parmas
    });
  },
  async editContractData(parmas) {
    return request({
      url: "/api/contractTemp",
      method: "post",
      data: parmas
    });
  },
  async previewContract(tempId) {
    return request({
      url: `/api/contractServer/read/${tempId}`,
      method: "get"
    });
  },
  async downloadContract(fileId) {
    return request({
      url: `/api/download2?id=${fileId}`,
      method: "get",
      responseType: "blob"
    });
  }
};

export default contractApi;
